<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<script type="text/javascript">
//数学对象
/*var x=Math.random();
//var y=Math.PI;//π
var y=Math.round(2.6);//四舍五入
document.write(y);//打印值*/

/*0-33
for (i=0;i<5;i++){
var x = Math.random()*30;
var y = Math.round(x); 
document.write(y+"<br>");
}*/
/*0-33
for (i=0;i<5;i++){
var x = Math.random()*32;
var y = Math.round(x+1); 
document.write(y+"<br>");
}*/

/*
var ss = "hello World"
//var x = ss.charAt(ss.length-1);
//var x = ss.indexOf(1);//从前向后查
//var x = ss.substring(6.14);
var x = ss.toUpperCase();//所有大写
//alert(ss.length)//字符串长度
alert(x)*/

/*
var ss = "hello World"
//document.writeln(ss.link("https://hao.360.cn/?src=bm"));
document.writeln(ss.fontcolor("red"),bold(),italics());*/

function setTime(){
var dt = new Date();
//document.write(dt.getFullYear()+"年"+(dt.getMonth()+1)+"月"+dt.getDate()+"日");(document.write(dt.getHours()+":"+dt.getMinutes()+":"+dt.getSeconds())
timer.innerHTML(document.write(dt.getFullYear()+"年"+(dt.getMonth()+1)+"月"+dt.getDate()+"日"+dt.getHours()+":"+dt.getMinutes()+":"+dt.getSeconds()));
}
//setTime();
</script>
</head>

<body>
<h1 id="timer">00:00:00</h1>
<script type="text/javascript">
setInterval(setTime,1000);
</script>
</body>
</html>
